import axios from 'axios'
import { ElMessage } from 'element-plus'

const service = axios.create({
    baseURL: 'http://127.0.0.1:8888/api/private/v1/',
    timeout: 10000,
})

service.interceptors.request.use(
    function (config: any) {
        return config
    },
    function (error: any) {
        return Promise.reject(error)
    }
)

service.interceptors.response.use(
    function (response) {
        const data = response.data
        return data
    },
    function (error) {
        return Promise.reject(error)
    }
)

export default service